import { $delete, $get } from '@js/authRequest'
import { message } from 'antd'

export async function getListRequest (condition, pageSize, current) {
  const res = await $get('/api/xapc/caseAcceptReport', {
    condition: JSON.stringify(condition),
    limit: pageSize,
    page: current
  })
  if (res.status !== 1) {
    message.error(res.message)
    throw new Error(res.message)
  }
  return res.data
}

export async function delRequest (id) {
  const res = await $delete(`/api/xapc/caseAcceptReport/${id}`)
  if (res.status !== 1) {
    message.error(res.message)
    throw new Error(res.message)
  }
  return res.data
}
